package com.huawei.hianalytics.f.g;

import android.text.TextUtils;
import com.huawei.hianalytics.util.d;
import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import java.security.SecureRandom;
import java.util.Locale;

public abstract class f {
    private static byte a(char c) {
        return (byte) "0123456789ABCDEF".indexOf(c);
    }

    public static String a() {
        byte[] bArr = new byte[16];
        new SecureRandom().nextBytes(bArr);
        return a(bArr);
    }

    public static String a(byte[] bArr) {
        return d.a(bArr);
    }

    public static byte[] a(String str) {
        int i = 0;
        if (TextUtils.isEmpty(str)) {
            return new byte[0];
        }
        String toUpperCase = str.toUpperCase(Locale.ENGLISH);
        int length = toUpperCase.length() / 2;
        char[] toCharArray = toUpperCase.toCharArray();
        byte[] bArr = new byte[length];
        while (i < length) {
            int i2 = i * 2;
            bArr[i] = (byte) (a(toCharArray[i2 + 1]) | (a(toCharArray[i2]) << 4));
            i++;
        }
        return bArr;
    }

    public static String b() {
        byte[] bArr = new byte[DnsConfig.MAX_CACHE_ENTRIES];
        new SecureRandom().nextBytes(bArr);
        return a(bArr);
    }

    public static String c() {
        return "a8cb572c8030b2df5c2b622608bea02b0c3e5d4dff3f72c9e3204049a45c0760cd3604af8d57f0e0c693cc";
    }
}
